import request from '@/config/axios'

// 开工物料关联 VO
export interface WorkMaterialRelVO {
  id: number // 编号
  workId: string // 开工ID
  inventoryId: string // 中间库物料ID
  creator:string
  createTime:string
  serialNo:string
}

// 开工物料关联 API
export const WorkMaterialRelApi = {
  // 查询开工物料关联分页
  getWorkMaterialRelPage: async (params: any) => {
    return await request.get({ url: `/opticore/work-material-rel/page`, params })
  },

  // 查询开工物料关联详情
  getWorkMaterialRel: async (id: number) => {
    return await request.get({ url: `/opticore/work-material-rel/get?id=` + id })
  },

  // 新增开工物料关联
  createWorkMaterialRel: async (data: WorkMaterialRelVO) => {
    return await request.post({ url: `/opticore/work-material-rel/create`, data })
  },

  // 修改开工物料关联
  updateWorkMaterialRel: async (data: WorkMaterialRelVO) => {
    return await request.put({ url: `/opticore/work-material-rel/update`, data })
  },

  // 删除开工物料关联
  deleteWorkMaterialRel: async (id: number) => {
    return await request.delete({ url: `/opticore/work-material-rel/delete?id=` + id })
  },

  // 导出开工物料关联 Excel
  exportWorkMaterialRel: async (params) => {
    return await request.download({ url: `/opticore/work-material-rel/export-excel`, params })
  }
}
